package datastructure.array

/**
 * [Left Rotation](https://www.hackerrank.com/challenges/array-left-rotation)
 */
fun leftRotation(array: Array<Int>, d: Int): Array<Int> {
    val size = array.size
    val n = d % size

    return Array(size) {
        array[(it + n) % size]
    }
}